package com.dcy.system.convert;

import com.dcy.system.vo.in.ResourceCreateInVO;
import com.dcy.system.vo.in.ResourceUpdateInVO;
import com.dcy.system.vo.out.ResourceListOutVO;
import com.dcy.system.model.Resource;
import org.mapstruct.Mapper;
import org.mapstruct.factory.Mappers;

import java.util.List;

/**
 * @Author：dcy
 * @Description:
 * @Date: 2020/10/23 15:03
 */
@Mapper
public interface ResourceConvert {

    ResourceConvert INSTANCE = Mappers.getMapper(ResourceConvert.class);

    /**
     * 创建DTO 转换 resource
     *
     * @param resourceCreateInVO
     * @return
     */
    Resource toResource(ResourceCreateInVO resourceCreateInVO);

    /**
     * 修改DTO 转换 resource
     *
     * @param resourceUpdateInVO
     * @return
     */
    Resource toResource(ResourceUpdateInVO resourceUpdateInVO);

    ResourceListOutVO toOut(Resource resource);

    List<ResourceListOutVO> toOutList(List<Resource> resourceList);
}
